﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class hyuan_info : System.Web.UI.Page
{
    protected string _cid = "86";
    protected string _id = "";
    protected int select = 1;
    protected int selects = 1;
    protected void Page_Load(object sender, EventArgs e)
    {
        _cid = Request.QueryString["cid"];
        if (string.IsNullOrEmpty(_cid))
        {

            _cid = "86";
        }
        else
        {
            if (_cid == "89")
                select = 0;
            if (!Whir.Common.WebHelper.Utils.IsInt(_cid))
                _cid = "86";
        }

        _id = Request.QueryString["id"];
        if (string.IsNullOrEmpty(_id))
        {

            Response.Redirect("Default.aspx");
        }
        else
        {

            if (!Whir.Common.WebHelper.Utils.IsInt(_id))
                Response.Redirect("Default.aspx");
        }
        if (Request.QueryString["mode"] != null)
            selects = 0;
        if (!IsPostBack)
        {
            GetInfo();
            GetTipsInfo();
        }
        
    }



    private void GetInfo()
    {
        string sql = string.Format("select * from Whir_U_Message where Whir_U_Message_PID='{0}' ", _id);
        DataTable dt = Whir.SQLServerDAL.DbHelperSQL.Query(sql).Tables[0];
        if (dt != null && dt.Rows.Count > 0)
        {
            string IsHandle = dt.Rows[0]["IsHandle"].ToString();
            //Whir.Common.WebHelper.JsHelper.redirect(this.Page, "留言正在处理中！", "index.aspx");

            ltrContent.Text = dt.Rows[0]["Content"].ToString();
            ltrCreateTime.Text =Convert.ToDateTime(dt.Rows[0]["CreateDate"].ToString()).ToString("yyyy-MM-dd");
            ltrPreson.Text = dt.Rows[0]["Person"].ToString();
            ltrTitle.Text = dt.Rows[0]["Title"].ToString();

            string RplDate = dt.Rows[0]["RepDate"].ToString();
            ltrRplContent.Text = dt.Rows[0]["RepContent"].ToString();
            ltrRplCreateDate.Text = (string.IsNullOrEmpty(RplDate)==true?"":Convert.ToDateTime(RplDate).ToString("yyyy-MM-dd"));
            
        }

    }
    private void GetTipsInfo()
    {
        ltrTips.Text = ColumnHelp.GetColumnName(_cid);
    }

   
}
